<template>
	<view class="gt-admin-page-info">
		<view v-if="template.pageInfo" class="row" style="flex-direction: row-reverse;">
			<uni-pagination :prevText="'上一页'" :nextText="'下一页'" :total="template.pageInfo.totalCount"
				:pageSize="template.pageInfo.limit" :current="template.pageInfo.page" @change="pagination">
			</uni-pagination>
			<!-- <gt-select class="gt-form-border gt-form-sm page-limit ml-15" v-model="limit"  :list="pageLimitList" placeholder="10"
				@change="changePageLimit">
			</gt-select> -->
			<!-- <input class="input-line input-page ml-15 mr-15" type="number" v-model="searchPage" />
			<button class="btn btn-sm " @click="skipPage()"
				:disabled="searchPage == '' || searchPage ==  template.pageInfo.page || searchPage > template.pageInfo.totalPage">{{ $t('跳转') }}</button> -->
		
		</view>
	</view>

</template>

<script>
	export default {
		name: "gt-admin-page-info",
		model: {
			prop: 'template',
			event: 'change'
		},
		props: {
			template: {}
		},
		data() {
			return {
				pageLimitList: [{
						key: 20,
						val: '20'
					},
					{
						key: 30,
						val: '30'
					},
					{
						key: 50,
						val: '50'
					},
					{
						key: 100,
						val: '100'
					},
				],
				searchPage: '',
				limit:'',
			}
		},
		methods: {
			changePageLimit(){
				
					this.$emit('pageInfoChange',{
						limit: this.limit
					});
			},
			//分页页数
			pagination(e) {
				this.$emit('pageInfoChange',{
					page: e.current
				});
			},
			//分页跳转
			skipPage() {
				this.$emit('pageInfoChange',{
					page: parseInt(this.searchPage)
				});
				this.searchPage = '';
			},
		}
	}
</script>

<style lang="scss" scoped>
.gt-admin-page-info{
	.btn{
		border: none;
	}
	.btn:active{
		border: none;
	}
}
</style>
